package com.jzmy.specialist.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.jzmy.specialist.entity.TrainingCertificates;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 *
 * <pre>
 * 培训证书
 * </pre>
 * <small> 2020-06-02 09:10:46 | lance</small>
 */
public interface TrainingCertificatesDao extends BaseMapper<TrainingCertificates> {


	@Select("select id , user_id as userId , courses_id as coursesId , numbers , get_time as getTime ," +
			"img_url as imgUrl , queries , state from jz_training_certificates where state = 0 and " +
			"user_id = #{userId} order by get_time desc")
	List<TrainingCertificates> findPageList(Page<TrainingCertificates> page, @Param("userId")Long userId);

	String selCerNumber(@Param("cerNums") String cerNums);
	
	String selByCerNumber(@Param("cerNums") String cerNums);

	List<Map> selImgUrls(Map map);
	List<Map> selNoSaleImgUrls(Map map);

	//查询全部列表
	List<Map>  rainingListX();

	//修改成阿里云OSS路径
	int updatetrainingX(@Param("img_url") String img_url, @Param("id") String id, @Param("img_url_nosale") String img_url_nosale);

}
